function Layout(getF, dispF) {

  /*
    handles mapping some functions (such as those in utils- files)
    to some nicer objects so that they can be accessed more easily
    and the rest of the code makes more sense and is easier to read
    e.g. workspaces.get is better than getWorkspaces
    also allows us to attach a few more functions if required to the object
  */

  this.get = getF;
  this.display = dispF

}

// workspace root
var workspace = new Layout(getWorkspace, displayWorkspace);

  workspace.change = function() {

    current = document.getElementById("workspaces").value;

    if (current == "workspace") {
    
      page.displayPage("workspace",null);
    
    } else {
      
      page.displayPage("workspace",current);
    
    }

  }

// dashboard / all workspaces
var allworkspaces = new Layout(getWorkspace, displayWorkspaces);

// login
var login = new Layout(getLogin, loginProcess);

  login.keypress = function(user, pass, event) {

    if (event.keyCode == 13) {
    
      event.preventDefault();

      login.display(document.getElementById("userin").value, document.getElementById("passin").value);
    
      return false;
    
    } else {
    
      return true;
    
    }

  }
  
// folder
var folder = new Layout(getFolder, displayFolder);

  folder.current = "";
  folder.set = function(id) {
    folder.current = id;
  }
  folder.getCurrent = function() {
    return folder.current;
  }

// file
var file = new Layout(getFile, displayFile);